<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>

<body>
    <div id="box" style="color:red;background-color: yellow;">box</div>
    <script>

        const box = document.getElementById('box');
        // console.log(box.getAttribute('style'));
        console.log(box.style.color);
        box.style.backgroundColor = 'yellowgreen';
        console.log(box.style.backgroundColor);
        // console.log(box.style['background-color']);


    </script>
</body>

</html>